package com.aletto.general_store.data.model;

import com.aletto.general_store.R;
import com.chad.library.adapter.base.entity.MultiItemEntity;

import java.io.Serializable;

public class ConsumerOrder extends OrderItem implements MultiItemEntity, Serializable {

    private static final long serialVersionUID = -2095916884810199123L;

    //        addItemType(1, R.layout.item_consumer_order_delivery); // 待发货
//        addItemType(2, R.layout.item_consumer_order_trade_dustbin); // 待收货
//        addItemType(3, R.layout.item_consumer_order_comment); // 待评分
//        addItemType(4, R.layout.item_consumer_order_refund); // 退款
    public static final int delivery = 1, dustbin = 2, comment = 3, refund = 4;

    private int itemType;

    public ConsumerOrder() {
        // 订单
    }

    public ConsumerOrder(int itemType) {
        this.itemType = itemType;
    }

    @Override
    public int getItemType() {
        // 状态, 1下单，2支付成功，3已发货，4途中，5申请退货，6退货中 7退货成功 8已签收 9已完成 10拒绝退款
        switch (getStatus()) {
            case 1:
            case 2:
                return delivery;

            case 3:
            case 4:
                return dustbin;

            case 8:
            case 9:
                return comment;

            case 5:
            case 6:
            case 7:
            case 10:
                return refund;
        }

        return itemType;
    }

}
